package com.hrt.bean;

import java.io.Serializable;
import java.sql.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

/**
 * 
 * @pdOid ee33741e-3779-498c-89ad-85771b7a794a
 * @author Administrator
 *
 */
/***********************************************************************
 * Module: ProductInfor.java Author: Administrator Purpose: Defines the
 * Class ProductInfor
 ***********************************************************************/

@Entity
@Table(name = "PRODUCT_INFOR")
@JsonIgnoreProperties(value = { "proType", "details" })
public class ProductInfor implements Serializable {

	

	/**
	 * 
	 */
	private static final long serialVersionUID = 7452800480027992471L;

	public ProductInfor() {

	}



	/**
	 * 产品ID
	 * 
	 * @pdOid b8511c05-3516-441b-a954-2acac8cb7ee9
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "PRO_ID")
	private Long id;

	@Transient
	private String typeName;
	/**
	 * 产品编号
	 * 
	 * @pdOid a4b2fdb7-050a-48e2-83c9-4d2e00197491
	 */
	@Column(name = "PRO_CODE", nullable = false)
	private java.lang.String proCode;
	/**
	 * 产品名称
	 * 
	 * @pdOid 0ac2e6df-26a2-4685-8128-5f2c6f8ef686
	 */
	@Column(name = "PRO_NAME", nullable = false)
	private java.lang.String proName;
	/**
	 * 产品主图片
	 * 
	 * @pdOid b81045c7-b546-4c94-96f2-a6fa4869dd49
	 */
	@Column(name = "PIC", nullable = false)
	private java.lang.String pic;

	/**
	 * 总库存
	 */
	@Column(name = "TOTAL", nullable = false)
	private Long total = 0l;

	/**
	 * 临界库存
	 */
	@Column(name = "MIN_TOTAL", nullable = false)
	private Long minTotal = 0l;

	/**
	 * 厂商
	 * 
	 * @pdOid 64318cb4-06fa-4b7e-bae4-3d69089352a5
	 */
	@Column(name = "FACTORY", nullable = true)
	private java.lang.String factory;

	@Column(name = "TYPE_ID", nullable = false, insertable = false, updatable = false)
	private Long typeId;

	@ManyToOne(cascade = { CascadeType.REFRESH, CascadeType.MERGE }, optional = false)
	@JoinColumn(name = "TYPE_ID")
	private ProType proType;

	/**
	 * 产地
	 * 
	 * @pdOid 98d79d4c-2d41-46ce-9a70-9c3248cb3219
	 */
	@Column(name = "GROW", nullable = true)
	private java.lang.String grown;

	/**
	 * 最小单位
	 * 
	 * @pdOid 14961408-d176-4c0e-9846-b9d3fbec4d0f
	 */
	@Column(name = "UNIT", nullable = true)
	private java.lang.String unit;

	// @Column(name = "TYPE_ID",nullable=false)
	// private Long typeId;
	/**
	 * 成本价
	 * 
	 * @pdOid fbbde938-48a7-4326-af56-17bbc85712b9
	 */
	@Column(name = "ENTER_PRICE", nullable = false)
	private Double enterPrice = 0d;

	/** @pdOid 1725068b-e8ae-4978-a9af-b529253f61d4 */
	@Column(name = "SALE_PRICE", nullable = false)
	private Double salePrice = 0d;
	/**
	 * 描述
	 * 
	 * @pdOid 0b15879e-0778-4c1c-8cf8-bd5ebd959aa0
	 */
	@Column(name = "DESCRIPTION", nullable = true)
	private java.lang.String description;
	/**
	 * 产品录入人ID,关联后台用户表主键
	 * 
	 * @pdOid d957c356-0095-4453-a288-81067aaa1c23
	 */
	@Column(name = "CREATOR_ID", nullable = false)
	private Long creatorId;
	/**
	 * 录入人名称
	 * 
	 * @pdOid da128680-8945-48b5-83a1-8058e879eb68
	 */
	@Column(name = "CREATOR_NAME", nullable = true)
	private java.lang.String creatorName;
	/**
	 * 创建时间, 默认系统当前时间
	 * 
	 * @pdOid fe36c2b8-602b-4a21-9854-218ffc1ed233
	 */
	@Column(name = "CREATE_TIME", nullable = false)
	private Date createTime = new Date(new java.util.Date().getTime());
	/**
	 * 修改人,第一次插入数据时，修改人与创建人一致
	 * 
	 * @pdOid be2a60e6-99ce-4f83-93cd-5905d4b79c7f
	 */
	@Column(name = "EDITOR", nullable = true)
	private java.lang.String editor;
	/**
	 * 产品修改人ID,关联后台用户表主键
	 * 
	 * @pdOid bfcdfc3a-e65a-41c3-bc87-59884de6b099
	 */
	@Column(name = "EDITOR_ID", nullable = false)
	private Long editorId;
	/**
	 * 最后修改时间,录入数据时，录入时间和最后修改时间一致
	 * 
	 * 
	 */
	@Column(name = "EDIT_TIME", nullable = false)
	private Date editTime;

	/**
	 * 删除标记 0未删除 1已删除
	 * 
	 *
	 */
	@Column(name = "ISDELETE", nullable = false)
	private Integer isdelete = 0;
	
	/**
	 * 是否是样品
	 * 0正式产品，1样品
	 */
	@Column(name = "ISDEMO", nullable = false)
	private Integer isdemo = 1;

	@Version
	@Column(name = "VERSION", nullable = false)
	private int version=0;

	/** @pdOid fd3d7fb5-3cf2-44ea-a9ef-9bbbda0d6963 */

	

	/** @pdOid bfdb0894-7518-4dea-b383-01450c7fab65 */
	public java.lang.String getProCode() {
		return proCode;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setEnterPrice(Double enterPrice) {
		this.enterPrice = enterPrice;
	}

	public void setSalePrice(Double salePrice) {
		this.salePrice = salePrice;
	}

	/**
	 * @param newProCode
	 * @pdOid f79231f8-a8ee-4709-9b8c-fb4d05b79cb5
	 */
	public void setProCode(java.lang.String newProCode) {
		proCode = newProCode;
	}

	/** @pdOid d4ace761-4585-4ae5-aade-d69c026d6689 */
	public java.lang.String getProName() {
		return proName;
	}

	/**
	 * @param newProName
	 * @pdOid 0404b497-cd16-4731-bc1f-6134395d5553
	 */
	public void setProName(java.lang.String newProName) {
		proName = newProName;
	}

	/** @pdOid 5eafd7e3-4865-49c0-a18d-ba33647300bc */
	public java.lang.String getPic() {
		return pic;
	}

	/**
	 * @param newPic
	 * @pdOid 6d24d709-453a-4c36-834c-1b4426328ca4
	 */
	public void setPic(java.lang.String newPic) {
		pic = newPic;
	}

	public java.lang.String getFactory() {
		return factory;
	}

	public void setFactory(java.lang.String factory) {
		this.factory = factory;
	}

	/** @pdOid ae18822b-fb76-4823-869e-a11629b17680 */
	public java.lang.String getGrown() {
		return grown;
	}

	/**
	 * @param newGrown
	 * @pdOid 340cbd9c-5462-4a60-99e1-30ad52f16dc0
	 */
	public void setGrown(java.lang.String newGrown) {
		grown = newGrown;
	}

	/** @pdOid 4d3c42a4-fb50-408f-b80c-718bc25096d3 */
	public java.lang.String getUnit() {
		return unit;
	}

	/**
	 * @param newUnit
	 * @pdOid 6d876e57-7a49-49ba-93ee-32d4728c4151
	 */
	public void setUnit(java.lang.String newUnit) {
		unit = newUnit;
	}

	/** @pdOid 6bb4a07b-54b8-42ae-bca0-943b8f3fa9f8 */
	public double getEnterPrice() {
		return enterPrice;
	}

	/**
	 * @param newEnterPrice
	 * @pdOid b399ad17-ca9a-4ed6-927b-c0f9c315cab7
	 */
	public void setEnterPrice(double newEnterPrice) {
		enterPrice = newEnterPrice;
	}

	/** @pdOid 95689c2d-0b34-4061-bbf9-df196d8d75a9 */
	public double getSalePrice() {
		return salePrice;
	}

	/**
	 * @param newSalePrice
	 * @pdOid 7343d5d3-f6bc-4c6a-b2be-d954b0e800a7
	 */
	public void setSalePrice(double newSalePrice) {
		salePrice = newSalePrice;
	}

	/** @pdOid db5ff4b5-9543-42c8-a654-5d31f7c4d2bd */
	public java.lang.String getDescription() {
		return description;
	}

	/**
	 * @param newDescription
	 * @pdOid 04b99b09-d4f2-4342-a184-3c9a18a0400b
	 */
	public void setDescription(java.lang.String newDescription) {
		description = newDescription;
	}

	/** @pdOid 298301a8-13e9-48f0-9bdd-2eb9958bdf62 */
	public Long getCreatorId() {
		return creatorId;
	}

	/**
	 * @param newCreatorId
	 * @pdOid 70c48c7d-1380-4610-a3d7-882db009158a
	 */
	public void setCreatorId(Long newCreatorId) {
		creatorId = newCreatorId;
	}

	/**
	 * @pdOid 63c1bcae-5ba2-4d9f-85e3-b60d88809667
	 * 
	 * */
	public java.lang.String getCreatorName() {
		return creatorName;
	}

	/**
	 * @param newCreatorName
	 * 
	 * @pdOid 47498f18-4a22-41c1-87cb-2c21a1cae99f
	 * 
	 */
	public void setCreatorName(java.lang.String newCreatorName) {
		creatorName = newCreatorName;
	}

	/** @pdOid 22211b5a-5d70-4189-8936-53fdda169109 */
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * @param newCreateTime
	 * @pdOid 197f2daa-b022-478e-bdc2-fb4ff0237cce
	 */
	public void setCreateTime(Date newCreateTime) {
		createTime = newCreateTime;
	}

	/** @pdOid 93d6fb38-bf33-4a5b-a661-8ec5bf2d559d */
	public java.lang.String getEditor() {
		return editor;
	}

	/**
	 * @param newEditor
	 * @pdOid c4ac00b7-8e5e-4fbb-b159-ccacfbb143ab
	 */
	public void setEditor(java.lang.String newEditor) {
		editor = newEditor;
	}

	/** @pdOid 527e107e-fdc7-4ca0-82d6-0e46c16c6a82 */
	public Long getEditorId() {
		return editorId;
	}

	/**
	 * @param newEditorId
	 * @pdOid f3ef7f95-f574-48ba-bb81-7f36e5f645b7
	 */
	public void setEditorId(Long newEditorId) {
		editorId = newEditorId;
	}

	/** @pdOid 682b9fc4-0de2-4346-82e5-142572fd4671 */
	public Date getEditTime() {
		return editTime;
	}

	/**
	 * @param newEditTime
	 * @pdOid 531d2778-bf4f-4971-bf50-2e75131eccca
	 */
	public void setEditTime(Date newEditTime) {
		editTime = newEditTime;
	}

	/** @pdOid cd037d7a-e8ab-49ea-a736-66c0c6ff6213 */
	public Integer getIsdelete() {
		return isdelete;
	}

	/**
	 * @param newIsdelete
	 * @pdOid 9173ce10-52cb-4915-8806-e1e90ac55964
	 */
	public void setIsdelete(Integer newIsdelete) {
		isdelete = newIsdelete;
	}

	/*
	 * public Long getTypeId() { return typeId; }
	 * 
	 * public void setTypeId(Long typeId) { this.typeId = typeId; }
	 */

	/**
	 * @pdGenerated default setter
	 * @param new产品详细信息表
	 */

	/** @pdGenerated default parent getter */

	public void setProType(ProType proType) {
		this.proType = proType;
	}

	public ProType getProType() {

		return proType;
	}

	public String getTypeName() {

		typeName = proType.getTypeName();

		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public Long getTotal() {
		if (total == null) {
			total = 0l;
		}
		return total;
	}

	public void setTotal(Long total) {
		this.total = total;
	}

	public Long getTypeId() {
		return typeId;
	}

	public void setTypeId(Long typeId) {
		this.typeId = typeId;
	}

	public Long getMinTotal() {
		return minTotal;
	}

	public void setMinTotal(Long minTotal) {
		this.minTotal = minTotal;
	}

	public Integer getIsdemo() {
		return isdemo;
	}

	public void setIsdemo(Integer isdemo) {
		this.isdemo = isdemo;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
}
